package com.barry;

import java.util.ArrayList;
import java.util.List;

/**
 * 类功能描述：//TODO
 *
 * @author WangXueXing create at 19-3-4 下午1:09
 * @version 1.0.0
 */
public class ListRemove {

    public static void main(String args[]){
        List<String> list = new ArrayList<>();
        list.add("abc");
        list.add("abc");
        list.add("bcd");

        for(String meta: list){
            if(meta.equals("abc")){
                list.add("abc");
            }
        }

       /* for(String meta: list){
            if(meta.equals("abc")){
                list.remove("abc");
            }
        }*/

        /*Iterator iterator = list.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            String meta = (String)iterator.next();
            if(meta.equals("abc"))
                list.remove("abc");
        } while(true);*/

       /* for(int i=0; i<=list.size(); i++){
            if(list.get(i).equals("abc")){
                list.remove("abc");
            }
        }*/
    }
}
